home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / sb / colr_mpl.zip / RSB4COLR.MOD < prev   
Text File  |  1992-06-14  |  16KB  |  326 lines

  1. 58250 ' $SUBTITLE: 'SmartText - smart text substitution'
  2. ' $PAGE
  3. '
  4. '  NAME    -- SmartText   (WRITTEN BY DOUG AZZARITO)
  5. '
  6. '  INPUTS  -- StringWork$        string to scan for Smart Text
  7. '             CRFound            Does this line contain a CR?
  8. '             ZSmartTextCode     Smart Text control code
  9. '
  10. '  OUTPUTS -- StringWork$        Input string with Smart replaced
  11. '
  12. '  PURPOSE -- Smart Text allows control strings in text files
  13. '             to be replaced at runtime with user info or other
  14. '             data.  The Smart Text control code is a 1-byte
  15. '             code (configurable) with a 2-byte action code.
  16. '
  17.       SUB SmartText (StringWork$, CRFound, OverStrike) STATIC
  18.       IF SmartCarry$<>"" THEN _
  19.          StringWork$ = SmartCarry$+StringWork$
  20.       Index = INSTR(StringWork$, ZSmartTextCode$)
  21.       WHILE Index > 0 AND Index < LEN(StringWork$)-1
  22.          IF INSTR(MID$(StringWork$, Index+1,2)," ") THEN _
  23.             SmartAct = 0 _
  24.          ELSE _
  25.             SmartAct = INSTR(ZSmartTable$, MID$(StringWork$, Index+1, 2))
  26.          IF SmartAct = 0 THEN _
  27.             WasI = 1 : _
  28.             GOTO 58254
  29.          SmartAct = (SmartAct+2)/3
  30.          ON SmartAct GOSUB 58260, 58261, 58262, 58263, 58264, 58265, _
  31.                            58266, 58267, 58268, 58269, 58270, _
  32.                            58271, 58272, 58273, 58274, 58275, _
  33.                            58276, 58277, 58296, 58296, 58296, _      ' DD061303/COLR
  34.                            58296, 58296, 58296, 58296, 58296, _      ' DD061303/COLR
  35.                            58296, 58296, 58296,_                     ' DD061303/COLR
  36.                            58278, 58279, 58280, _                    ' DD061303/COLR
  37.                            58281, 58282, 58283, 58284, 58285, _
  38.                            58286, 58287, 58289, 58290, 58291, _
  39.                            58292, 58293, 58294, 58295
  40.          GOSUB 58256
  41.          WasI = LEN(SmartHold$)
  42.          ReplaceLen = 3
  43.          IF OverStrike OR Overlay THEN _
  44.             IF WasI > 2 THEN _
  45.                ReplaceLen = WasI _
  46.             ELSE _
  47.                SmartHold$ = SmartHold$ + SPACE$(3 - WasI)
  48.          StringWork$ = LEFT$(StringWork$, Index-1) + SmartHold$ + _
  49.                        MID$(StringWork$,Index+ReplaceLen)
  50. 58254    Index = INSTR(Index+WasI, StringWork$, ZSmartTextCode$)
  51.       WEND
  52.       IF Index AND (Index > LEN(StringWork$)-2) AND NOT CRFound THEN _
  53.          SmartCarry$ = MID$(StringWork$,Index) : _
  54.          StringWork$ = LEFT$(StringWork$,Index-1) : _
  55.       ELSE _
  56.          SmartCarry$ = ""
  57.       EXIT SUB
  58. 58256 IF TrimSmart THEN _
  59.          CALL Trim (SmartHold$)
  60.       RETURN
  61. 58258 ZLastSmartColor$ = SmartHold$
  62.       RETURN
  63. 58260 ZLinesPrinted = 0                     ' CS (Clear screen line count reset)
  64.       SmartHold$ = ""
  65.       RETURN
  66. 58261 ZLinesPrinted = ZPageLength           ' PB Page Break
  67.       IF ZNonStop THEN _                    ' force a 1-time pause
  68.          ZOneStop = ZTrue : _               ' if NON STOP is on
  69.          ZNonStop = ZFalse
  70.       SmartHold$ = ""
  71.       ZForceKeyboard = ZTrue
  72.       RETURN
  73. 58262 ZNonStop = ZTrue                      ' NS Non-stop
  74.       SmartHold$ = ""
  75.       RETURN
  76. 58263 IF ZGlobalSysop THEN _                ' FN First Name
  77.          SmartHold$ = ZOrigSysopFN$ _
  78.       ELSE SmartHold$ = ZFirstName$
  79.       CALL NameCaps(SmartHold$)
  80.       RETURN
  81. 58264 IF ZGlobalSysop THEN _
  82.          SmartHold$ = ZOrigSysopLN$ _
  83.       ELSE SmartHold$ = ZLastName$
  84.       CALL NameCaps(SmartHold$)
  85.       RETURN
  86. 58265 SmartHold$ = STR$(ZUserSecLevel)     ' SL Security level       ' KG052201
  87.       CALL Trim (SmartHold$)                                         ' KG052201
  88.       RETURN
  89. 58266 SmartHold$ = DATE$                         ' DT Date
  90.       RETURN
  91. 58267 CALL AMorPM
  92.       SmartHold$ = ZTime$                        ' TM Time
  93.       RETURN
  94. 58268 CALL TimeRemain(MinsRemaining)
  95.       SmartHold$ = MID$(STR$(INT(MinsRemaining)),2)
  96.       RETURN
  97. 58269 CALL TimeRemain(MinsRemaining)      ' TE Time elapsed (mm:ss)
  98.       SmartHold$ = MID$(STR$(INT(ZSecsUsedSession!/60)),2)+":"+ _
  99.          MID$(STR$((ZSecsUsedSession! MOD 60)+100),3)
  100.       RETURN
  101. 58270 SmartHold$ = MID$(STR$(INT((ZTimeLockSet+0.5)/60)),2) ' TL - Time Lock period
  102.       SmartHold$ = SmartHold$ + ":"+ MID$(STR$((ZTimeLockSet MOD 60)+100),3)
  103.       RETURN
  104. 58271 SmartHold$ = MID$(STR$(ZDaysInRegPeriod),2)
  105.       RETURN                                ' RP Registration Length
  106. 58272 SmartHold$ = MID$(STR$(ZRegDaysRemaining),2)
  107.       RETURN                                ' RR Registration Remaining
  108. 58273 SmartHold$ = ZCityState$              ' CT Users CITY & STATE
  109.       CALL Trim (SmartHold$)                                         ' DD032301
  110.       RETURN
  111. 58274 SmartHold$ = ZFG1$                    ' C1 Color 1
  112.       GOTO 58258
  113. 58275 SmartHold$ = ZFG2$                    ' C2 Color 2
  114.       GOTO 58258
  115. 58276 SmartHold$ = ZFG3$                    ' C3 Color 3
  116.       GOTO 58258
  117. 58277 SmartHold$ = ZFG4$                    ' C4 Color 4
  118.       GOTO 58258
  119. 58278 SmartHold$ = ZEmphasizeOff$           ' C0 Reset color
  120.       ZLastSmartColor$ = ""
  121.       RETURN
  122. 58279 SmartHold$ = MID$(STR$(INT(ZDLToday!)),2)
  123.       RETURN                                ' DD files Dnlded TODAY
  124. 58280 SmartHold$ = MID$(STR$(INT(ZBytesToday!)),2)
  125.       RETURN                                ' BD Bytes Dnlded TODAY
  126. 58281 SmartHold$ = MID$(STR$(INT(ZDLBytes!)),2)
  127.       RETURN                                ' DB Download Bytes
  128. 58282 SmartHold$ = MID$(STR$(INT(ZULBytes!)),2)
  129.       RETURN                                ' UB Upload Bytes
  130. 58283 SmartHold$ = MID$(STR$(ZDnlds),2)     ' DL Number of Dnlds
  131.       RETURN
  132. 58284 SmartHold$ = MID$(STR$(ZUplds),2)     ' UL Number of Uplds
  133.       RETURN
  134. 58285 SmartHold$ = ZFileName$               ' FI  File Name
  135.       RETURN
  136. 58286 Overlay = ZTrue                       ' VY Overlay ON
  137.       GOTO 58288
  138. 58287 Overlay = ZFalse                      ' VN Overlay OFF
  139. 58288 SmartHold$ = ""
  140.       RETURN
  141. 58289 TrimSmart = ZTrue                     ' TY Trim Yes
  142.       GOTO 58288
  143. 58290 TrimSmart = ZFalse                    ' TN Trim No
  144.       GOTO 58288
  145. 58291 SmartHold$ = ZRBBSName$               ' BN Board Name
  146.       RETURN
  147. 58292 SmartHold$ = ZNodeID$                 ' ND Node Number
  148.       IF SmartHold$ >= "A" THEN _
  149.          SmartHold$ = MID$(STR$(ASC(SmartHold$) - 54),2)
  150.       RETURN
  151. 58293 SmartHold$ = ZSysopFirstName$          ' FS Sysops First Name
  152.       CALL NameCaps(SmartHold$)
  153.       RETURN
  154. 58294 SmartHold$ = ZSysopLastName$          ' LS Sysops First Name
  155.       CALL NameCaps(SmartHold$)
  156.       RETURN
  157. 58295 SmartHold$ = ZConfName$               ' CN Conference Name     ' TC070704
  158.       RETURN
  159. 58296 IF SmartAct = 19 THEN SmartHold$ = ZFG5$
  160.       IF SmartAct = 20 THEN SmartHold$ = ZFG6$                       ' DD061303/COLR
  161.       IF SmartAct = 21 THEN SmartHold$ = ZFG7$                       ' DD061303/COLR
  162.       IF SmartAct = 22 THEN SmartHold$ = ZFG8$                       ' DD061303/COLR
  163.       IF SmartAct = 23 THEN SmartHold$ = ZFG9$                       ' DD061303/COLR
  164.       IF SmartAct = 24 THEN SmartHold$ = ZFGA$                       ' DD061303/COLR
  165.       IF SmartAct = 25 THEN SmartHold$ = ZFGB$                       ' DD061303/COLR
  166.       IF SmartAct = 26 THEN SmartHold$ = ZFGC$                       ' DD061303/COLR
  167.       IF SmartAct = 27 THEN SmartHold$ = ZFGD$                       ' DD061303/COLR
  168.       IF SmartAct = 28 THEN SmartHold$ = ZFGE$                       ' DD061303/COLR
  169.       IF SmartAct = 29 THEN SmartHold$ = ZFGF$                       ' DD061303/COLR
  170.       GOTO 58258                                                     ' DD061303/COLR
  171.       END SUB                                                        ' DD061303/COLR
  172. '
  173. 59934 ' $SUBTITLE: 'SetHiLite - subroutine to reset highlight preference'
  174. ' $PAGE
  175. '
  176. '  NAME    --  SetHiLite
  177. '
  178. '  INPUTS  --  PARAMETER                   MEANING
  179. '              SetTo              New value (True or False)
  180. '              ZEmphasizeOnDef$   String turns emphasize on
  181. '              ZEmphasizeOffDef$  String turns emphasize off
  182. '
  183. '  OUTPUTS --  ZHiLiteOff       Callers preference on Hilite
  184. '              ZEmphasizeOn$       String to use for emphasis
  185. '              ZEmphasizeOff$      String to use after emphasis
  186. '
  187.       SUB SetHiLite (SetTo) STATIC
  188.       ZHiLiteOff = (ZEmphasizeOnDef$ <> "" AND SetTo)
  189.       IF ZHiLiteOff THEN _
  190.          ZEmphasizeOn$ = "" : _
  191.          ZEmphasizeOff$ = "" : _
  192.          ZFG1$ = "" : _
  193.          ZFG2$ = "" : _
  194.          ZFG3$ = "" : _
  195.          ZFG4$ = "" : _                                              ' DD061303/COLR
  196.          ZFG5$ = "" : _                                              ' DD061303/COLR
  197.          ZFG6$ = "" : _                                              ' DD061303/COLR
  198.          ZFG7$ = "" : _                                              ' DD061303/COLR
  199.          ZFG8$ = "" : _                                              ' DD061303/COLR
  200.          ZFG9$ = "" : _                                              ' DD061303/COLR
  201.          ZFGA$ = "" : _                                              ' DD061303/COLR
  202.          ZFGB$ = "" : _                                              ' DD061303/COLR
  203.          ZFGC$ = "" : _                                              ' DD061303/COLR
  204.          ZFGD$ = "" : _                                              ' DD061303/COLR
  205.          ZFGE$ = "" _                                                ' DD061303/COLR
  206.       ELSE ZEmphasizeOn$ = ZEmphasizeOnDef$ : _
  207.            ZFG1$ = ZFG1Def$ : _
  208.            ZFG2$ = ZFG2Def$ : _
  209.            ZFG3$ = ZFG3Def$ : _
  210.            ZFG4$ = ZFG4Def$ : _                                      ' DD061303/COLR
  211.            ZFG5$ = ZEscape$ + "[1;34;40m" : _     'Brt Blue          ' DD061303/COLR
  212.            ZFG6$ = ZEscape$ + "[1;35;40m" : _     'Brt Magenta       ' DD061303/COLR
  213.            ZFG7$ = ZEscape$ + "[1;33;44m" : _     'Yellow/Blue       ' DD061303/COLR
  214.            ZFG8$ = ZEscape$ + "[1;33;42m" : _     'Yellow/Green      ' DD061303/COLR
  215.            ZFG9$ = ZEscape$ + "[1;33;41m" : _     'Yellow/Red        ' DD061303/COLR
  216.            ZFGA$ = ZEscape$ + "[1;33;45m" : _     'Yellow/Magenta    ' DD061303/COLR
  217.            ZFGB$ = ZEscape$ + "[1;37;44m" : _     'White/Blue        ' DD061303/COLR
  218.            ZFGC$ = ZEscape$ + "[1;37;42m" : _     'White/Green       ' DD061303/COLR
  219.            ZFGD$ = ZEscape$ + "[1;37;41m" : _     'White/Red         ' DD061303/COLR
  220.            ZFGE$ = ZEscape$ + "[1;37;45m" : _     'White/Magenta     ' DD061303/COLR
  221.            ZFGF$ = ZEscape$ + "[1;36;44m"         'Brt Cyan/Blue     ' DD061303/COLR
  222.       END SUB
  223. 59965 ' $SUBTITLE: 'UserColor - lets user set color for normal text'
  224. ' $PAGE
  225. '
  226. '  NAME    --  UserColor
  227. '
  228. '  INPUTS  --  PARAMETER                   MEANING
  229. '              ZEmphasizeOff$            Normal text color
  230. '
  231. '  OUTPUTS --  ZEmphasizeOff$            New text color
  232. '              ZBoldText$                Whether bold (0 not, 1 bold)
  233. '              ZUserTextColor            ANSI Color selected
  234. '
  235. '  PURPOSE --  Lets caller select desired color and whether bold.
  236. '
  237.       SUB UserColor STATIC
  238.       IF ZHiLiteOff THEN _
  239.          EXIT SUB _                                                  ' DD061303/COLR
  240.       ELSE _                                                         ' DD061303/COLR
  241.          ZFG5$ = ZEscape$ + "[1;34;40m" : _     'Brt Blue          ' DD061303/COLR
  242.          ZFG6$ = ZEscape$ + "[1;35;40m" : _     'Brt Magenta       ' DD061303/COLR
  243.          ZFG7$ = ZEscape$ + "[1;33;44m" : _     'Yellow/Blue       ' DD061303/COLR
  244.          ZFG8$ = ZEscape$ + "[1;33;42m" : _     'Yellow/Green      ' DD061303/COLR
  245.          ZFG9$ = ZEscape$ + "[1;33;41m" : _     'Yellow/Red        ' DD061303/COLR
  246.          ZFGA$ = ZEscape$ + "[1;33;45m" : _     'Yellow/Magenta    ' DD061303/COLR
  247.          ZFGB$ = ZEscape$ + "[1;37;44m" : _     'White/Blue        ' DD061303/COLR
  248.          ZFGC$ = ZEscape$ + "[1;37;42m" : _     'White/Green       ' DD061303/COLR
  249.          ZFGD$ = ZEscape$ + "[1;37;41m" : _     'White/Red         ' DD061303/COLR
  250.          ZFGE$ = ZEscape$ + "[1;37;45m" : _     'White/Magenta     ' DD061303/COLR
  251.          ZFGF$ = ZEscape$ + "[1;36;44m"         'Brt Cyan/Blue     ' DD061303/COLR
  252. 59970 CALL QuickTPut (ZEmphasizeOff$,0)
  253.       ZOutTxt$ = "Make text R)ed,G)reen,Y)ellow,B)lue,P)urple,C)yan,W)hite" + ZPressEnterExpert$
  254.       GOSUB 59973
  255.       IF ZWasQ = 0 THEN _
  256.          ZEmphasizeOff$ = ZEscape$ + "[" + ZBoldText$ + _
  257.              ";40;" + MID$(STR$(ZUserTextColor),2) + "m" : _
  258.          EXIT SUB
  259.       CALL AllCaps (ZUserIn$)
  260.       WasX = INSTR("RGYBPCW",ZUserIn$)
  261.       IF WasX = 0 THEN _
  262.          GOTO 59970
  263.       ZUserTextColor = 30 + WasX
  264.       ZOutTxt$ = "Make text Bright? (Y,[N])"                         ' DD060101
  265.       GOSUB 59973
  266.       ZBoldText$ = CHR$(48 - ZYes)
  267.       ZEmphasizeOff$ = ZEscape$ + "[" + ZBoldText$ + ";40;" + MID$(STR$(ZUserTextColor),2) + "m"
  268.       GOTO 59970
  269. 59973 ZSubParm = 1
  270.       ZTurboKey = -ZTurboKeyUser
  271.       CALL TGet
  272.       IF ZSubParm = -1 THEN _
  273.          EXIT SUB
  274.       RETURN
  275.       END SUB
  276. 59980 ' $SUBTITLE: 'SetGraphic - Sets user graphic preference'
  277. ' $PAGE
  278. '
  279. '  NAME    --  SetGraphic
  280. '
  281. '  INPUTS  --  PARAMETER                   MEANING
  282. '              GraphicsNumber        0=None, 1=Ascii, 2=color
  283. '
  284. '  OUTPUTS --  ZWasGR                Shared var - set to
  285. '                                    graphics.number
  286. '              ZUserGraphicDefault$ What add to file name to         ' KG022003
  287. '                                    see if got graphics file ver
  288. '
  289. '  PURPOSE --  Sets file graphics preference
  290. '
  291.       SUB SetGraphic (GraphicsNumber) STATIC                         ' KG022003
  292.       ZWasGR = GraphicsNumber
  293.       IF ZWasGR = 2 THEN _
  294.          ZDR1$ = ZFG1Def$ : _
  295.          ZDR2$ = ZFG2Def$ : _
  296.          ZDR3$ = ZFG3Def$ : _
  297.          ZDR4$ = ZFG4Def$ : _                                        ' DD061303/COLR
  298.          ZDR5$ = ZFG5$ : _                                           ' DD061303/COLR
  299.          ZDR6$ = ZFG6$ : _                                           ' DD061303/COLR
  300.          ZDR7$ = ZFG7$ : _                                           ' DD061303/COLR
  301.          ZDR8$ = ZFG8$ : _                                           ' DD061303/COLR
  302.          ZDR9$ = ZFG9$ : _                                           ' DD061303/COLR
  303.          ZDRA$ = ZFGA$ : _                                           ' DD061303/COLR
  304.          ZDRB$ = ZFGB$ : _                                           ' DD061303/COLR
  305.          ZDRC$ = ZFGC$ : _                                           ' DD061303/COLR
  306.          ZDRD$ = ZFGD$ : _                                           ' DD061303/COLR
  307.          ZDRE$ = ZFGE$ : _                                           ' DD061303/COLR
  308.          ZDRF$ = ZFGF$ _                                             ' DD061303/COLR
  309.       ELSE ZDR1$ = "" : _
  310.            ZDR2$ = "" : _
  311.            ZDR3$ = "" : _
  312.            ZDR4$ = "" : _                                            ' DD061303/COLR
  313.            ZDR5$ = "" : _                                            ' DD061303/COLR
  314.            ZDR6$ = "" : _                                            ' DD061303/COLR
  315.            ZDR7$ = "" : _                                            ' DD061303/COLR
  316.            ZDR8$ = "" : _                                            ' DD061303/COLR
  317.            ZDR9$ = "" : _                                            ' DD061303/COLR
  318.            ZDRA$ = "" : _                                            ' DD061303/COLR
  319.            ZDRB$ = "" : _                                            ' DD061303/COLR
  320.            ZDRC$ = "" : _                                            ' DD061303/COLR
  321.            ZDRD$ = "" : _                                            ' DD061303/COLR
  322.            ZDRE$ = "" : _                                            ' DD061303/COLR
  323.            ZDRF$ = ""                                                ' DD061303/COLR
  324.       ZUserGraphicDefault$ = MID$(" GC",ZWasGR+1, - (ZWasGR > 0))    ' KG022003
  325.       END SUB
  326.